//
//  Teachers_View.m
//  teaching
//
//  Created by yishangpin2 on 15/4/30.
//  Copyright (c) 2015年 衣尚品1. All rights reserved.
//

#import "Teachers_View.h"

@implementation Teachers_View


- (void)drawRect:(CGRect)rect {
    self.JiBenZiLiaoBigHeight.constant = 0;
    self.JiBenZiLiaoSmallView.hidden = YES;
    self.GeRenJianJieBigHeight.constant = 0;
    self.GeRenJianJieSmallView.hidden = YES;
    self.JiaoXueJingYanHeight.constant = 0;
    self.JiaoXueJingYanSmallView.hidden = YES;
    self.ShouKeXiangGuanHeight.constant = 0;
    self.ShouKeXiangGuanSmallView.hidden = YES;
    self.FuJiaHeight.constant = 0;
    self.FuJiaSmallView.hidden = YES;

    
}

-(void)hidden:(UIView *)view{
    view.hidden=YES;
}


- (IBAction)JiBenZiLiaoClick:(id)sender {
    if (self.JiBenZiLiaoBigHeight.constant == 0) {
        self.JiBenZiLiaoBigHeight.constant = 380;
        [UIView animateWithDuration:0.5 animations:^{
            [self.JiBenZiLiaoBigView layoutIfNeeded];
            [self.GeRenJianJie layoutIfNeeded];
            [self.JiaoXueJingYan layoutIfNeeded];
            [self.ShouKeXiangGuan layoutIfNeeded];
            [self.FuJia layoutIfNeeded];
            self.JiBenZiLiaoSmallView.hidden = NO;
        }];
    }
    else
    {
        self.JiBenZiLiaoBigHeight.constant = 0;
        [UIView animateWithDuration:0.5 animations:^{
            [self.JiBenZiLiaoBigView layoutIfNeeded];
            [self.GeRenJianJie layoutIfNeeded];
            [self.JiaoXueJingYan layoutIfNeeded];
            [self.ShouKeXiangGuan layoutIfNeeded];
            [self.FuJia layoutIfNeeded];
            
        }];
        
        [self performSelector:@selector(hidden:) withObject:self.JiBenZiLiaoSmallView afterDelay:0.3f];

    }
    
}





- (IBAction)GeRenJianJieClick:(id)sender {
    if (self.GeRenJianJieBigHeight.constant == 0) {
        self.GeRenJianJieBigHeight.constant = 239;
        [UIView animateWithDuration:0.5 animations:^{
            [self.GeRenJianJieBigView layoutIfNeeded];
            [self.JiaoXueJingYan layoutIfNeeded];
            [self.ShouKeXiangGuan layoutIfNeeded];
            [self.FuJia layoutIfNeeded];
            self.GeRenJianJieSmallView.hidden = NO;
        }];
    }
    else
    {
        self.GeRenJianJieBigHeight.constant = 0;
        [UIView animateWithDuration:0.5 animations:^{
            [self.GeRenJianJieBigView layoutIfNeeded];
            [self.JiaoXueJingYan layoutIfNeeded];
            [self.ShouKeXiangGuan layoutIfNeeded];
            [self.FuJia layoutIfNeeded];
            
        }];
        
        [self performSelector:@selector(hidden:) withObject:self.GeRenJianJieSmallView afterDelay:0.3f];
        
    }

}
- (IBAction)JiaoXueJingYanClick:(id)sender {
    if (self.JiaoXueJingYanHeight.constant == 0) {
        self.JiaoXueJingYanHeight.constant = 121;
        [UIView animateWithDuration:0.5 animations:^{
            [self.JiaoXueJingYanBigView layoutIfNeeded];
            [self.ShouKeXiangGuan layoutIfNeeded];
            [self.FuJia layoutIfNeeded];
            
            self.JiaoXueJingYanSmallView.hidden = NO;
        }];
    }
    else
    {
        self.JiaoXueJingYanHeight.constant = 0;
        [UIView animateWithDuration:0.5 animations:^{
            [self.JiaoXueJingYanBigView layoutIfNeeded];
            [self.ShouKeXiangGuan layoutIfNeeded];
            [self.FuJia layoutIfNeeded];
            
        }];
        
        [self performSelector:@selector(hidden:) withObject:self.JiaoXueJingYanSmallView afterDelay:0.3f];
        
    }

}
- (IBAction)ShouKeXiangGuanClick:(id)sender {
    
    if (self.ShouKeXiangGuanHeight.constant == 0) {
        self.ShouKeXiangGuanHeight.constant = 172;
        [UIView animateWithDuration:0.5 animations:^{
            [self.ShouKeXiangGuanBigView layoutIfNeeded];
            [self.FuJia layoutIfNeeded];
            
            self.ShouKeXiangGuanSmallView.hidden = NO;
        }];
    }
    else
    {
        self.ShouKeXiangGuanHeight.constant = 0;
        [UIView animateWithDuration:0.5 animations:^{
            [self.ShouKeXiangGuanBigView layoutIfNeeded];
            [self.FuJia layoutIfNeeded];
            
        }];
        
        [self performSelector:@selector(hidden:) withObject:self.ShouKeXiangGuanSmallView afterDelay:0.3f];
        
    }

}
- (IBAction)FuJiaClick:(id)sender {
    if (self.FuJiaHeight.constant == 0) {
        self.FuJiaHeight.constant = 172;
        [UIView animateWithDuration:0.5 animations:^{
            [self.FuJiaBigVIew layoutIfNeeded];
//            [self.FuJia layoutIfNeeded];
            
            self.FuJiaSmallView.hidden = NO;
        }];
    }
    else
    {
        self.FuJiaHeight.constant = 0;
        [UIView animateWithDuration:0.5 animations:^{
            [self.FuJiaBigVIew layoutIfNeeded];
//            [self.FuJia layoutIfNeeded];
            
        }];
        
        [self performSelector:@selector(hidden:) withObject:self.FuJiaSmallView afterDelay:0.3f];
        
    }

}

#pragma mark -隐藏键盘
- (IBAction)HideKeyBoard:(id)sender {
    [self endEditing:YES];
    
}
@end
